package loan.calc.dto.request;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.ToString;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;


@Data
@ToString(callSuper = true)
@Schema( description = "试算请求数据")
public class TrialRequestDTO implements Serializable {

    /**
     * 本金总额
     */
    @NotNull
    @Min(1)
    @Schema( description = "本金总额",example = "1000000")
    private BigDecimal applyAmount;

    /**
     * 起始日
     * 发放日
     */
    @NotNull
    @Schema(description = "贷款起始日/发放日",example = "2023-01-01")
    private LocalDate startDate;

    /**
     * 结束日
     */
    @NotNull
    @Schema(description = "贷款到期日/结束日",example = "2033-01-01")
    private LocalDate maturityDate;

    /**
     * 利率
     */
    @NotNull
    @Valid
    @Schema(description = "利率请求数据")
    private RateRequestDTO rate;

    /**
     * 还款方式
     */
    @Schema(description = "还款方式请求数据")
    @Valid
    @NotEmpty
    private List<RepayMethodSegmentRequestDTO> repayMethodList;

}
